# $Id: PKGBUILD 179293 2013-03-04 21:34:48Z andrea $
# Maintainer: Ronald van Haren <ronald.archlinux.org>

pkgname=qwt
pkgver=6.0.2
pkgrel=2
pkgdesc="Qt Widgets for Technical Applications"
arch=('i686' 'x86_64')
url="http://qwt.sourceforge.net/"
depends=('qt4')
license=("custom:$pkgname")
source=("http://downloads.sourceforge.net/${pkgname}/$pkgname-$pkgver.tar.bz2" \
        "qwtconfig-archlinux.pri")
sha1sums=('cbdd00b29521987c9e7bc6aa51092f0474b9428d'
          'aba0fc75f6d450237028b7b143bdcf05a79cabb3')

build() {
  cd ${srcdir}/${pkgname}-${pkgver}

  # copy our config file to the right place
  cp ${srcdir}/qwtconfig-archlinux.pri qwtconfig.pri

  # build qwt:
  qmake-qt4 qwt.pro
  make
}

package() {
  cd ${srcdir}/${pkgname}-${pkgver}

  make INSTALL_ROOT=${pkgdir} install

  # install web designer plugin
  install -d ${pkgdir}/usr/lib/qt4/plugins/designer/
  install -Dm755 designer/plugins/designer/libqwt_designer_plugin.so \
    ${pkgdir}/usr/lib/qt4/plugins/designer/

  # needed by qmake (FS#30407)
  install -d "${pkgdir}"/usr/share/qt4/mkspecs/features/
  install -m644 qwtconfig.pri qwt.prf qwtfunctions.pri \
    "${pkgdir}"/usr/share/qt4/mkspecs/features/

  # move man pages
  mv "${pkgdir}"/usr/share/doc/qwt/man/ "${pkgdir}"/usr/share/

  # install licence
  install -Dm644 ${srcdir}/${pkgname}-${pkgver}/COPYING \
	${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
}
